/*
 * BattleMasterInterface.cpp
 *
 *  Created on: Oct 23, 2011
 *      Author: gonzalo
 */

#include "BattleMasterInterface.h"
#include "../persistencia/Persistor.h"
#include "../common/Translator/Translator.h"
#include "../common/Constantes.h"

BattleMasterInterface::BattleMasterInterface(std::string scenarioName,bool) {
	this->scenarioName =scenarioName;
	esServer =true;
}

BattleMasterInterface::BattleMasterInterface(std::string owner){
	this->owner = owner;
	esServer = false;
}
BattleMasterInterface::~BattleMasterInterface() {
}


std::list<ScenarioElement*> BattleMasterInterface::getElements(){
	if (esServer) {
		return Persistor::getScenarioElements(scenarioName);
	}

	return Translator::translateScenarioElementDTO(scenarioElements);
}

std::string BattleMasterInterface::getBackgroundPath(){
	if (esServer) {
		return Persistor::getBackground(scenarioName);
	}

	return background->getImagePath();

}

std::string BattleMasterInterface::getOwner(){
	return this->owner;
}

void BattleMasterInterface::setScenearioElements(std::list<DTOScenarioElement*> listElements){
	this->scenarioElements = listElements;
}

void BattleMasterInterface::setBackground(DTOBackground* bgr){
	this->background =bgr;
}
